function [ error_epoca ] = calculoDeError( patrones, pesos, beta )
%CALCULODEERROR Summary of this function goes here
%   Detailed explanation goes here

error_epoca = 0;
%cantidad de entradas
n = length(patrones(1,:))-2;

for i=1:1:length(patrones(:,1))
        
        patron = patrones(i,:);
        esperado = patron(n+2);
        
        patron = patron(1:n+1);
    
        h = sum(patron .* pesos);
        
        error_epoca = error_epoca + (esperado - g(h,beta))^2;
end

error_epoca = error_epoca * 0.5;
end

